#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int a[N], ans;
bool cmp(int x, int y)
{
    return x > y;
}
int main()
{
    int n, x, y, t;
    cin >> n >> x >> y;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    sort(a + 1, a + n + 1, cmp);
    for (int i = 1; i <= n; i++)
    {
        t = ans;
        if (a[i] > y)
            ans += 3;
        else if (a[i] < x)
            ans -= 1;
        ans = max(ans, t);
    }
    cout << ans << endl;
    return 0;
}